package com.zbu.system.domain.exam.dto;

import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import org.apache.ibatis.annotations.Lang;

import java.util.Set;
@Data
public class ExamQuestAddDTO {
    @JsonSerialize(using = ToStringSerializer.class)
    private Long examId;
    private Set<Long> questionIdSet;
    @JsonSetter("examId")
    public void setExamId(String examId) {
        if ("undefined".equals(examId) || examId == null || examId.isEmpty()) {
            this.examId = null; // 或者赋值为一个默认值，如：0L
        } else {
            this.examId = Long.parseLong(examId); // 将字符串转换为 Long 类型
        }
    }

}
